Explains how C# handles unmanaged pointers via the garbage collector and IDisposable to prevent memory leaks during P/Invoke or COM interop.